package com.joanzapata.pdfview;

import android.net.Uri;
import android.os.AsyncTask;
import org.vudroid.core.DecodeService;
import org.vudroid.core.DecodeServiceBase;
import org.vudroid.pdfdroid.codec.PdfContext;

/* loaded from: classes.dex */
class DecodingAsyncTask extends AsyncTask<Void, Void, Void> {
    private boolean cancelled = false;
    private DecodeService decodeService;
    private PDFView pdfView;
    private Uri uri;

    public DecodingAsyncTask(Uri uri, PDFView pDFView) {
        this.pdfView = pDFView;
        this.uri = uri;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // android.os.AsyncTask
    public Void doInBackground(Void... voidArr) {
        this.decodeService = new DecodeServiceBase(new PdfContext());
        this.decodeService.setContentResolver(this.pdfView.getContext().getContentResolver());
        this.decodeService.open(this.uri);
        return null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // android.os.AsyncTask
    public void onPostExecute(Void r2) {
        if (this.cancelled) {
            return;
        }
        this.pdfView.loadComplete(this.decodeService);
    }

    @Override // android.os.AsyncTask
    protected void onCancelled() {
        this.cancelled = true;
    }
}
